package com.wen40.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.wen40.domain.Addresses;
import com.wen40.domain.AddressesExample;

@Mapper
public interface AddressesMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addresses
     *
     * @mbggenerated Thu Nov 03 14:38:14 CST 2016
     */
    int countByExample(AddressesExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addresses
     *
     * @mbggenerated Thu Nov 03 14:38:14 CST 2016
     */
    int deleteByExample(AddressesExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addresses
     *
     * @mbggenerated Thu Nov 03 14:38:14 CST 2016
     */
    @Delete({
        "delete from addresses",
        "where ADDR_ID = #{addrId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer addrId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addresses
     *
     * @mbggenerated Thu Nov 03 14:38:14 CST 2016
     */
    @Insert({
        "insert into addresses (ADDR_ID, STREET, ",
        "CITY, STATE, ZIP, ",
        "COUNTRY)",
        "values (#{addrId,jdbcType=INTEGER}, #{street,jdbcType=VARCHAR}, ",
        "#{city,jdbcType=VARCHAR}, #{state,jdbcType=VARCHAR}, #{zip,jdbcType=VARCHAR}, ",
        "#{country,jdbcType=VARCHAR})"
    })
    int insert(Addresses record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addresses
     *
     * @mbggenerated Thu Nov 03 14:38:14 CST 2016
     */
    int insertSelective(Addresses record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addresses
     *
     * @mbggenerated Thu Nov 03 14:38:14 CST 2016
     */
    List<Addresses> selectByExample(AddressesExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addresses
     *
     * @mbggenerated Thu Nov 03 14:38:14 CST 2016
     */
    @Select({
        "select",
        "ADDR_ID, STREET, CITY, STATE, ZIP, COUNTRY",
        "from addresses",
        "where ADDR_ID = #{addrId,jdbcType=INTEGER}"
    })
    @ResultMap("com.wen40.mapper.AddressesMapper.BaseResultMap")
    Addresses selectByPrimaryKey(Integer addrId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addresses
     *
     * @mbggenerated Thu Nov 03 14:38:14 CST 2016
     */
    int updateByExampleSelective(@Param("record") Addresses record, @Param("example") AddressesExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addresses
     *
     * @mbggenerated Thu Nov 03 14:38:14 CST 2016
     */
    int updateByExample(@Param("record") Addresses record, @Param("example") AddressesExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addresses
     *
     * @mbggenerated Thu Nov 03 14:38:14 CST 2016
     */
    int updateByPrimaryKeySelective(Addresses record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addresses
     *
     * @mbggenerated Thu Nov 03 14:38:14 CST 2016
     */
    @Update({
        "update addresses",
        "set STREET = #{street,jdbcType=VARCHAR},",
          "CITY = #{city,jdbcType=VARCHAR},",
          "STATE = #{state,jdbcType=VARCHAR},",
          "ZIP = #{zip,jdbcType=VARCHAR},",
          "COUNTRY = #{country,jdbcType=VARCHAR}",
        "where ADDR_ID = #{addrId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Addresses record);
}